package com.iscas.green.extralindextest.config;

import feign.Logger;
import feign.Request;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

/**
 * Feign客户端配置类
 */
@Configuration
public class FeignConfig {

    /**
     * 配置Feign客户端的日志级别，用于调试
     */
    @Bean
    public Logger.Level feignLoggerLevel() {
        // FULL级别会记录请求和响应的headers、body和元数据
        return Logger.Level.FULL;
    }
    
    /**
     * 配置Feign客户端的超时时间
     */
    @Bean
    public Request.Options options() {
        // 连接超时10秒，读取超时30秒
        return new Request.Options(
                10, TimeUnit.SECONDS,
                30, TimeUnit.SECONDS,
                true
        );
    }
} 